package com.jielihaofeng.atguigu.dubborpc.customer;

import com.jielihaofeng.atguigu.dubborpc.netty.NettyClient;
import com.jielihaofeng.atguigu.dubborpc.publicinterface.HelloService;

/**
 * @author Johnnie Wind
 * @description 客户端启动
 * @date 2021/11/24 17:57
 */
public class ClientBootstrap {

    // 这里定义协议头
    public static String providerName = "HelloService#hello#";

    public static void main(String[] args) {
        // 创建一个消费者
        NettyClient customer = new NettyClient();

        // 创建代理对象
        HelloService service = (HelloService) customer.getBean(HelloService.class, providerName);

        // 通过代理对象调用服务提供者的方法
        String res = service.hello("你好 dubbo~");
        System.out.println("调用的结果 res= " + res);
    }
}
